/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package com.googlecode.ivybeans.module.options;

import java.io.File;
import org.netbeans.spi.options.AdvancedOption;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.modules.InstalledFileLocator;
import org.openide.util.NbBundle;

/**
 *
 * @author lforet
 */
public class IvyAdvancedOption extends AdvancedOption {

    private File ivyHome;

    public IvyAdvancedOption() {
        File file = InstalledFileLocator.getDefault().locate("modules/ext/ivy.jar", "fr.jayasoft.ivy.ant", false);
        ivyHome = file.getParentFile();
        System.setProperty("ivy.home", ivyHome.getAbsolutePath());
    }

    @Override
    public OptionsPanelController create() {
        return new IvyOptionsPanelController(this);
    }

    @Override
    public String getDisplayName() {
        return NbBundle.getMessage(IvyAdvancedOption.class, "TIT_Ivy_Category");
    }

    @Override
    public String getTooltip() {
        return NbBundle.getMessage(IvyAdvancedOption.class, "TIP_Ivy_Category");
    }

    public File getIvyHome() {
        return ivyHome;
    }

    public void setIvyHome(File ivyHome) {
        this.ivyHome = ivyHome;
    }
    
    
}
